/**
 * 
 */
package com.daatak.customer.domain;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;



/**
 * @author e3005468
 *
 */
@Entity
@Table(name="TEMP_CUSTOMER") 
public class CustomerObject {
	
	@Id
	@GeneratedValue
	@Column(name="CUSTOMER_ID") 
	private  Integer customerId;
	
	@Column(name="REF_ID") 
	private  Integer referenceId;
	
	@Column(name="REF_TYPE") 
	String  referenceType;/*Reference type for (Main Applicant),(Co-Applicant) and References*/
	
	@Column(name="FIRST_NAME") 
	private String firstName;
	
	@Column(name="LAST_NAME") 
	private String lastName;
	
	@Column(name="MIDDLE_NAME") 
	private String middleName;
	@Column(name="INITIAL") 
	private String initial;
	@Column(name="MOBILE_PHONE") 
	private String mobilePhone;
	@Column(name="BIRTH_DATE") 
	private Date dateOfBirth;
	@Column(name="SSN") 
	private String ssn;
	@Column(name="GUARDIAN_NAME") 
	private String guardianName;
	@Column(name="TYPE") 
	private String type;
	@Column(name="STATUS") 
	private String status;
	@Column(name="EMAIL_ID") 
	private String emailId;
	
	
	 @OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	 private Set<EmplomentObject> employment=new HashSet<EmplomentObject>();
	 
	 @OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	 @JoinColumn(name = "REF_ID")
	 private Set<CustomerAddress> address=new HashSet<CustomerAddress>();
	 
	 @Embedded
	 private MortgageObject mortgage;
	
	public Integer getCustomerId() {
		return customerId;
	}
	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getMiddleName() {
		return middleName;
	}
	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}
	public String getInitial() {
		return initial;
	}
	public void setInitial(String initial) {
		this.initial = initial;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public Date getDateOfBirth() {
		return dateOfBirth;
	}
	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}
	public String getSsn() {
		return ssn;
	}
	public void setSsn(String ssn) {
		this.ssn = ssn;
	}
	public String getGuardianName() {
		return guardianName;
	}
	public void setGuardianName(String guardianName) {
		this.guardianName = guardianName;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getEmailId() {
		return emailId;
	}
	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}
	
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public Integer getReferenceId() {
		return referenceId;
	}
	public void setReferenceId(Integer referenceId) {
		this.referenceId = referenceId;
	}
	public String getReferenceType() {
		return referenceType;
	}
	public void setReferenceType(String referenceType) {
		this.referenceType = referenceType;
	}
	
	public Set<EmplomentObject> getEmployment() {
		return employment;
	}
	public void setEmployment(Set<EmplomentObject> employment) {
		this.employment = employment;
	}
	public Set<CustomerAddress> getAddress() {
		return address;
	}
	public void setAddress(Set<CustomerAddress> address) {
		this.address = address;
	}
	@Override
	public String toString() {
		return "CustomerObject [customerId=" + customerId + ", referenceId="
				+ referenceId + ", referenceType=" + referenceType
				+ ", firstName=" + firstName + ", lastName=" + lastName
				+ ", middleName=" + middleName + ", initial=" + initial
				+ ", mobilePhone=" + mobilePhone + ", dateOfBirth="
				+ dateOfBirth + ", ssn=" + ssn + ", guardianName="
				+ guardianName + ", type=" + type + ", status=" + status
				+ ", emailId=" + emailId +  ", employment=" + employment + ", address=" + address + "]";
	}
	public MortgageObject getMortgage() {
		return mortgage;
	}
	public void setMortgage(MortgageObject mortgage) {
		this.mortgage = mortgage;
	}

}
